package com.wxd.woff.graphics;

import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.io.OutputStream;

/**
 * woff图像生成接口
 * <p>
 * Created with IntelliJ IDEA.
 *
 * @author: wangxindong
 * @date: 2018/9/6-19:31
 */
public interface WoffImage {

    /**
     * 获取BufferedImage
     *
     * @return
     * @throws IOException
     */
    BufferedImage getImage() throws IOException;

    /**
     *
     */
    BufferedImage getImage(int type) throws IOException;

    /**
     * 将BufferedImage写入输出流
     */
    void write(BufferedImage image, OutputStream out) throws IOException;

    void write(BufferedImage image, String formatName, OutputStream out) throws IOException;

    void write(BufferedImage image, String formatName, String fileName) throws IOException;

    /**
     * 图片是否有数据
     *
     * @return
     */
    boolean isEmpty();

    /**
     * 获取height
     */
    int getHeight();

    /**
     * 获取width
     */
    int getWidth();

    /**
     * 文件后缀名 eg: jpg
     *
     * @return
     */
    String getSuffix();

    Graphics2D getGraphics2D() throws IOException;

}
